﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Configuration;

namespace Wicresoft.EKA.NRemedy.Test
{
    //加入到path 将 dll们。
    [TestClass]
    public class ARProxyTestW
    {
        [TestMethod]
        public void TestMethod1Pool()
       { 
            string ARServer = ConfigurationManager.AppSettings["ARServer"];
            string ARUid = ConfigurationManager.AppSettings["ARUid"];
            string ARPwd = ConfigurationManager.AppSettings["ARPwd"];
            ARLoginContext context = new ARLoginContext(ARServer, ARUid, ARPwd,ARServerFactoryWithPool.Instance);
            GlobalSettings.SetCharacterEncoding("UTF8");
            ARLoginContext context0 = new ARLoginContext(ARServer, ARUid, ARPwd, ARServerFactoryWithPool.Instance);
            GlobalSettings.SetCharacterEncoding("UTF8");
            ARLoginContext context1 = new ARLoginContext(ARServer, ARUid, ARPwd, ARServerFactoryWithPool.Instance);
            GlobalSettings.SetCharacterEncoding("UTF8");
            ARLoginContext context2 = new ARLoginContext(ARServer, ARUid, ARPwd, ARServerFactoryWithPool.Instance);
            GlobalSettings.SetCharacterEncoding("UTF8");
            ARProxy<RegularForm> proxy = new ARProxy<RegularForm>(context);
        }

        [TestMethod]
        public void TestMethod1NOPool()
        {
            string ARServer = ConfigurationManager.AppSettings["ARServer"];
            string ARUid = ConfigurationManager.AppSettings["ARUid"];
            string ARPwd = ConfigurationManager.AppSettings["ARPwd"];
            ARLoginContext context = new ARLoginContext(ARServer, ARUid, ARPwd);
            GlobalSettings.SetCharacterEncoding("UTF8");
            ARLoginContext context0 = new ARLoginContext(ARServer, ARUid, ARPwd);
            GlobalSettings.SetCharacterEncoding("UTF8");
            ARLoginContext context1 = new ARLoginContext(ARServer, ARUid, ARPwd);
            GlobalSettings.SetCharacterEncoding("UTF8");
            ARLoginContext context2 = new ARLoginContext(ARServer, ARUid, ARPwd);
            GlobalSettings.SetCharacterEncoding("UTF8");
            ARProxy<RegularForm> proxy = new ARProxy<RegularForm>(context);
        }
    }
}
